class Page6 extends BaseScreen {
    public constructor() {
        super();
        this.skinName = "resource/eui_skins/Page6Skin.exml";
    }

	private img_1: eui.Image;
    private img_2: eui.Image;
    private img_3: eui.Image;
    private img_4: eui.Image;
    private number_1:NumbersTxtPage;
    private number_2:NumbersTxtPage;
    private number_3:NumbersTxtPage;
    private number_4:NumbersTxtPage;

    private img_2_x: number = 0;
    private img_3_x: number = 0;

    protected childrenCreated(): void {
        super.childrenCreated();
        this.init_view();
    }

    public init_view() {
        this.img_2_x = this.img_2.y;
        this.img_3_x = this.img_3.y;

        // this.img_3.mask = this['mask_3'];
        // this.img_4.mask = this['mask_4'];
        
        this.resetui();
    }

    public resetui(){
        this.img_1.alpha = 0;
        this.img_2.x = -this.img_2.width;
        this.img_3.x = this.width;
        // this.img_2.alpha = 0;
        // this.img_2.scaleY = 0;
        // this.img_2.x = -this.img_2.width;

        // this.img_2.anchorOffsetX = this.img_2.width * 0.5;
        // this.img_2.anchorOffsetY = this.img_2.height * 0.5;
        // this.img_2.x += this.img_2.width * 0.5;
        // this.img_2.y += this.img_2.height * 0.5;

        // this.img_2.scaleY = this.img_2.scaleX = 0;
        
        // this.number_3.num_txt.textAlign = 'left';
        // this.number_4.num_txt.textAlign = 'left';
        // this.img_3.y = this.img_3_y + this.img_3.height;
        // this.img_4.y = this.img_4_y + this.img_4.height;
        // this.number_1.visible = this.number_2.visible = false;
        // this.number_3.visible = this.number_4.visible = false;
        if(this.xx_page){
            this.xx_page.stop();
        }
    }

    public showPage() {
        super.showPage();
        this.resetui();

        egret.Tween.get(this.img_1).to({ alpha:1}, 2000);
        // egret.Tween.get(this.img_2).wait(200).to({ alpha:1,x:0}, 900,egret.Ease.backOut);
        egret.Tween.get(this.img_2).wait(200).to({ x:0}, 1000,egret.Ease.backOut);
        egret.Tween.get(this.img_3).wait(200).to({ x:0}, 1000,egret.Ease.backOut);
        // egret.Tween.get(this.img_3).wait(300).to({ y: this.img_3_y}, 1200, egret.Ease.backOut);
        // egret.Tween.get(this.img_4).wait(1000).to({ y: this.img_4_y}, 1500, egret.Ease.backOut);

        // this.number_1.startMove(125.26,1000,1200,40,'%','125.26%');
        // this.number_2.startMove(27.60,1000,1200,40,'%','27.60%');
        // this.number_3.startMove(2985,1000,1200,40,'','2,985.48');
        // this.number_4.startMove(34,1000,1200,41,'','34%');

        if(this.xx_page){
            this.xx_page.start();
        }
    }

    protected process(){
        // this.number_1.updateNum();
        // this.number_2.updateNum();
        // this.number_3.updateNum();
        // this.number_4.updateNum();
    }
}